<?php
 /*
  *总后台运营商模型类
  */
namespace Home\Model; 
use Think\Model;
class YunyingUserModel extends Model
{
	public function index($arg=array())
	{
			
			$condi['keywords']=$arg['keywords'];
			$condition=' 1=1 ';
			if(!empty($condi['keywords']))
			{
				$condition.=" AND  connectname like '%{$condi['keywords']}%' OR yname like '%{$condi['keywords']}%' OR mobile  like '%{$condi['keywords']}%' OR area like '%{$condi['keywords']}%' OR address like '%{$condi['keywords']}%' OR companyname  like '%{$condi['keywords']}%' OR  qq  like '%{$condi['keywords']}%' ";
			}
			
			$sql="select * from ".C(DB_PREFIX).'yunying_user where'.$condition;
			
			$users=M()->query($sql);
			foreach($users as $k=>$v)
			{
              if($v['isdel']==1)
              {
                $users[$k]['frozen']='已冻结';
              }else
              {
                     $users[$k]['frozen']='冻结';
              }
			}
			
			return $users;
	}
}